home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / catD / kmem_zalloc.z / kmem_zalloc
Encoding:
Text File  |  2002-10-03  |  6.2 KB  |  132 lines

  1.  
  2.  
  3.  
  4. kkkkmmmmeeeemmmm____zzzzaaaalllllllloooocccc((((DDDD3333))))                                                kkkkmmmmeeeemmmm____zzzzaaaalllllllloooocccc((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc - allocate and clear space from kernel free memory
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_kkkk_mmmm_eeee_mmmm_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  15.      _vvvv_oooo_iiii_dddd _****_kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc_((((_ssss_iiii_zzzz_eeee______tttt _s_i_z_e_,,,, _iiii_nnnn_tttt _f_l_a_g_))))_;;;;
  16.  
  17.    AAAArrrrgggguuuummmmeeeennnnttttssss
  18.      _s_i_z_e      Number of bytes to allocate.
  19.  
  20.      _f_l_a_g      Specifies whether the caller is willing to sleep waiting for
  21.                memory, also other flags accepted by _kkkk_mmmm_eeee_mmmm______aaaa_llll_llll_oooo_cccc.
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc allocates _s_i_z_e bytes of kernel memory, clears the memory by
  25.      filling it with zeros, and returns a pointer to the allocated memory.  If
  26.      _f_l_a_g is set to _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP, the caller will sleep if necessary until the
  27.      specified amount of memory is available.  If _f_l_a_g is set to _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP,
  28.      the caller will not sleep, but _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc will return _NNNN_UUUU_LLLL_LLLL if the
  29.      specified amount of memory is not immediately available.
  30.  
  31.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  32.      Upon successful completion, _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc returns a pointer to the
  33.      allocated memory.  If _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP is specified and sufficient memory is
  34.      not immediately available, _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc returns a _NNNN_UUUU_LLLL_LLLL pointer.  If _s_i_z_e
  35.      is set to _0000, _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc returns _NNNN_UUUU_LLLL_LLLL regardless of the value of _f_l_a_g.
  36.  
  37. UUUUSSSSAAAAGGGGEEEE
  38.      Kernel memory is a limited resource and should be used judiciously.
  39.      Memory allocated using _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc should be freed as soon as possible.
  40.      Drivers should not use local freelists for memory or similar schemes that
  41.      cause the memory to be held for longer than necessary.
  42.  
  43.      Since holding memory allocated using _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc for extended periods of
  44.      time (e.g allocating memory at system startup and never freeing it) can
  45.      have an adverse effect on overall memory usage and system performance,
  46.      memory needed for such extended periods should be statically allocated
  47.      whenever possible.
  48.  
  49.      The address returned by a successful call to _kkkk_mmmm_eeee_mmmm______zzzz_aaaa_llll_llll_oooo_cccc is word-aligned.
  50.  
  51.    LLLLeeeevvvveeeellll
  52.      Initialization or Base if _f_l_a_g is set to _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP.
  53.  
  54.      Initialization, Base or Interrupt if _f_l_a_g is set to _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP.
  55.  
  56.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  57.      May sleep if _f_l_a_g is set to _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP.
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. kkkkmmmmeeeemmmm____zzzzaaaalllllllloooocccc((((DDDD3333))))                                                kkkkmmmmeeeemmmm____zzzzaaaalllllllloooocccc((((DDDD3333))))
  69.  
  70.  
  71.  
  72.      Driver-defined basic locks, read/write locks, and sleep locks may be held
  73.      across calls to this function if _f_l_a_g is _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP, but may not be held
  74.      if _f_l_a_g is _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP.
  75.  
  76.      Driver-defined sleep locks may be held across calls to this function
  77.      regardless of the value of _f_l_a_g.
  78.  
  79. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  80.      _kkkk_mmmm_eeee_mmmm______aaaa_llll_llll_oooo_cccc(D3), _kkkk_mmmm_eeee_mmmm______ffff_rrrr_eeee_eeee(D3)
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.